package com.situ.crm.service.impl;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.situ.crm.service.TestService;

@Service("testService")
public class TestServiceImpl implements TestService {

	@Override
	public void test3() {

//		Thread t = new Thread(new Thread1());
//		t.start();

		new Thread(() -> System.out.println("1111")).start();

	}

	@Override
	@Async
	@Transactional
	public void doSomething() {
		System.out.println("开始执行doSomething");
		try {
			Thread.sleep(10000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("doSomething执行完了");
	}

	class Thread1 implements Runnable {

		@Override
		public void run() {
			try {
				Thread.sleep(10000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		}

	}

}
